package com.study.spmongodb.wwj.thread.char01;

import java.util.concurrent.TimeUnit;

/**
 * @author MI
 * @version 1.0
 * @date 2020/12/5 21:27
 */
public class TryConcurrency {

    public static void main(String[] args) {

    }

    private static void readFromDb() {
        try {
            prinln("Begin read data from db");
            TimeUnit.SECONDS.sleep(10);
            prinln("read db handle");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    private static void writeDataTofirle() {
        try {
            prinln("Begin writeDataTofirle");
            TimeUnit.SECONDS.sleep(10);
            prinln("writeDataTofirle finished");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    private static void prinln(String msg) {
        System.out.println(msg);
    }

}
